package com.larry.resend.tais;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import com.pegatron.ers.server.app.helper.ContextHelper;
import com.pegatron.ers.vo.common.CommonDataModel;

public class DISPProcessor extends TaisCommonProcessor {

	public DISPProcessor() {
		super("ShipService", "submitExpressShip", "com.pegatron.ers.server.app.message.edi.toshiba.am.ToshibaAMEdiDISPSender", "com.pegatron.ers.jms.edi.toshiba.am.executor.ToshibaAMEdiDISPMessageConsumer");
	}

	@Override
	public void process(String key) throws Exception {
		super.orderNum = key;
		this.sendMessage();
	}

	@Override
	public void initData() {

	}

	@Override
	public void prepareParams() throws Exception {
		initParams = new ArrayList<Object>();
		List<CommonDataModel> result = ContextHelper.getToshibaAMEdiService().getToshibaAMEdi(orderNum, rmaSite);
		if (result == null || result.isEmpty()) {
			return;
		}
		CommonDataModel ediOrder = result.get(0);
		BigDecimal orderNo = ediOrder.getBigDecimal("ORDER_NO");
		initParams.add(rmaSite);
		initParams.add("BOXSHIP");
		initParams.add(orderNo);
		initParams.add(null);
		String entryNo = "SYSADMIN";
		initParams.add(entryNo);
	}
}
